<!DOCTYPE html>
<html lang="en">
<#import "/spring.ftl" as spring/>
<head>
    <meta charset="UTF-8">
    <title>用户资料</title>
    <#include "../styleandscript.ftl"/>
    <style>
        table {
            table-layout: fixed;
            border-spacing: 0;
            border-collapse: collapse;
            border: 1px deepskyblue solid;
        }
        td {
            padding: 4px;
        }
    </style>
</head>
<body>
<#include "../header.ftl"/>
<table style="margin-top: 16px; margin-bottom: 16px;">
    <tr><td bgcolor="#f0f8ff" colspan="3">用户信息</td></tr>
    <tr>
        <td>账号：</td>
        <td>${u.name}</td>
        <td></td>
    </tr>
    <tr>
        <td>邮箱：</td>
        <td><#if u.email??>${u.email}<#else>未设置</#if></td>
        <td></td>
    </tr>
    <tr>
        <td>创建时间：</td>
        <td><#if u.createTime??>${u.createTime?datetime}</#if></td>
        <td></td>
    </tr>
    <tr>
        <#if u?? && userSelf?? && u.id==userSelf.id>
            <td><a href="/user/update/pwd">修改密码</a></td>
            <td><a href="/blog/edit">写文章</a></td>
            <td><a href="/user/manager/list/1">管理文章</a></td>
            <#else>
            <td></td>
            <td></td>
            <td></td>
        </#if>
    </tr>
</table>
<#include "../bloglist.ftl"/>
<#if blogPageInfo.pages gt 0 >
    <div>
        <#if blogPageInfo.hasPreviousPage>
            <a href="/user/center/${u.name}/list/${blogPageInfo.prePage}">上一页</a>
        <#else>
            上一页&nbsp;&nbsp;
        </#if>
        <#list 1..blogPageInfo.pages as item>
            <#if item==blogPageInfo.pageNum>
                ${item}&nbsp;
            <#else>
                <a href="/user/center/${u.name}/list/${item}">${item}</a>&nbsp;
            </#if>
        </#list>
        <#if blogPageInfo.hasNextPage>
            <a href="/user/center/${u.name}/list/${blogPageInfo.nextPage}">下一页</a>
        <#else>
            下一页
        </#if>
    </div>
</#if>
</body>
</html>